<%--
  Created by IntelliJ IDEA.
  User: wang
  Date: 2022/11/28
  Time: 22:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>更新信息</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
  <script src="js/jquery-3.6.1.min.js"></script>
  <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
  <link rel="stylesheet" href="css/font-awesome.min.css">

</head>
<body>
<nav class="navbar navbar-default navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button
              type="button"
              class="navbar-toggle collapsed"
              data-toggle="collapse"
              data-target="#bs-example-navbar-collapse-1"
              aria-expanded="false"
      >
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active">
          <a href="#">Link <span class="sr-only">(current)</span></a>
        </li>
        <li><a href="${pageContext.request.contextPath}/index.jsp">退出</a></li>
        <li class="dropdown">
          <a
                  href="#"
                  class="dropdown-toggle"
                  data-toggle="dropdown"
                  role="button"
                  aria-haspopup="true"
                  aria-expanded="false"
          >Dropdown <span class="caret"></span
          ></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>
      <form class="navbar-form navbar-left">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" />
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a
                  href="#"
                  class="dropdown-toggle"
                  data-toggle="dropdown"
                  role="button"
                  aria-haspopup="true"
                  aria-expanded="false"
          >Dropdown <span class="caret"></span
          ></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </li>
      </ul>
    </div>
    <!-- /.navbar-collapse -->
  </div>
  <!-- /.container-fluid -->
</nav>

<div class="container">
  <form
          action="${pageContext.request.contextPath}/UpdateUserGoodsController"
          method="post"
          class="form-horizontal col-sm-offset-3 col-md-offset-3"
  >
    <h3 class="form-title">更新商品信息</h3>
    <div class="col-sm-9 col-md-9">
      <div class="form-group">
        <!--        用户名图标和用户名输入框            -->
        <i class="fa fa-user" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="id"
                id="id"
                value="${userGoods.id}"
                required
                autofocus
        />
      </div>
      <div class="form-group">
        <!--        用户名图标和用户名输入框            -->
        <i class="fa fa-user" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="username"
                id="username"
                value="${userGoods.username}"
                required
                autofocus
        />
      </div>
      <!--        密码图标和密码输入框                -->
      <div class="form-group">
        <i class="fa fa-key" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="goodname"
                id="goodname"
                value="${userGoods.goodname}"
                required
        />
      </div>
      <div class="form-group">
        <i class="fa fa-key" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="goodtype"
                id="goodtype"
                value="${userGoods.goodtype}"
                required
        />
      </div>

      <div class="form-group">
        <i class="fa fa-key" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="changemedium"
                id="changemedium"
                value="${userGoods.changemedium}"
                required
        />
      </div>

      <div class="form-group">
        <i class="fa fa-key" aria-hidden="true"></i>
        <input
                class="form-control"
                type="text"
                name="changeway"
                id="changeway"
                value="${userGoods.changeway}"
                required
        />
      </div>

    </div>


    <script>
      // 在离开页面之前提示用户修改成功
      window.onbeforeunload = function book() {
        $("#myModal").modal("show");
        setTimeout(function () {
          $("#myModal").modal("hide");
        }, 1200);
      }
    </script>
    <div class="form-group">
      <input
              type="submit"
              value="修改"
              class="btn btn-success pull-right"
              onclick="book()"
      />
      <div
              class="modal fade bd-example-modal-sm"
              id="myModal"
              role="dialog"
              data-backdrop="false"
              aria-hidden="true"
      >
        <div class="modal-dialog modal-sm">
          <div class="modal-content">
            <p class="text-center mb-0">
              <i
                      class="fa fa-check-circle text-success mr-1"
                      aria-hidden="true"
              ></i>
              提交成功
            </p>
          </div>
        </div>
      </div>
    </div>
  </form>
</div>
</body>
</html>
